  import { GET_INIT_LIST, INPUT_VALUE_CHANGE, PUSH_ARR_DATA } from './actionTypes'

  const defaultState = {
    inputValue: '1',
    list: [10,11]
  }
  export default (state = defaultState, action)=> {
    const newState = JSON.parse(JSON.stringify(state))
    if (action.type === GET_INIT_LIST) {
      newState.list = action.value
    }
    if (action.type === INPUT_VALUE_CHANGE) {
      newState.inputValue = action.value
      console.log(newState)
    }
    if (action.type === PUSH_ARR_DATA) {
      newState.list = action.value
      newState.inputValue = ''
    }
    return newState;
  }